import 'package:freedom/page/mahjong/common/mahjong_context.dart';
import 'package:freedom/page/mahjong/common/message_content.dart';
import 'package:freedom/page/mahjong/event/snatch_bar_event.dart';
import 'package:freedom/page/mahjong/message/abstract_action_message.dart';

class SnatchBarAction extends AbstractMessageActionHandler<MahjongMessage> {
  @override
  void doMessage(MahjongMessage message) {
    var userDiskInfo = MahjongContext.getUserStateById(message.exeActionUid);
    if (userDiskInfo == null) {
      return;
    }

    MahjongContext.postUserEvent<SnatchBarEvent>(message.exeActionUid,
        SnatchBarEvent(message.exeActionUid, message.cardCode!));
  }
}
